<template>
  <div>
    <div>{{ msg }}</div>
    <button @click="handleClick">发送</button>
  </div>
</template>

<script setup>
import { defineProps, defineEmits } from "vue";

const props = defineProps(["msg", 'onUpdate']);
const emit = defineEmits(["update"]);

function handleClick() {
  emit("update", { name: "gh" });
  props.onUpdate({ name: "gh" })
}
</script>
